
cd "/Users/eliemurard/Dropbox/WorldBank Refugee project/World Dev revision/replication/" 


* Table 4: Refugee resettlement and political fragmentation

* Table 5: Refugee resettlement and turnout


use department_crime,clear 

			
					
	global option varlabels tex plain fragment bdec(3) se starloc(1) starlevels(10 5 1) nocenter ///
		summstat(r2 \ N) summtitle( "$ R^2 $"\"Observations") summdec(3 0)  blankrows 

	*define controls for specification 	
	
	global model_1  "Population 2011","Y" \ "Geography controls","" \ "Socio-Economic Development 1991",""  
	global model_2  "Population 2011","Y" \"Geography controls","Y" \ "Socio-Economic Development 1991",""  
	global model_3  "Population 2011","Y" \"Geography controls","Y" \ "Socio-Economic Development 1991","Y"    

	      
	global m1 ln_pop2011  
	global m2 $m1  island  elevation prcp_ann  
	global m3 $m2 secondary1991 tertiary1991 emp_noagri1991  
	
	global T1  sh_refugees1928 
	global T1b sh_refugees1923 
	global treat T1 T1b
	 
	global dependent ln_crime  
		
	
foreach outcome of varlist $dependent  {	
		
	local labout : variable label  `outcome'
	
	foreach typemodel in $treat  {
		
		outreg, clear(base`typemodel'_dep)

		global TREATkeep ${`typemodel'}  
			
				
		qui su `outcome'    
		local av: di %4.3f  r(mean)
				
		foreach k in  1 2 3     { 	
	
		dis " `labout' -  model `k' -  ${mods}" 
			qui  reg `outcome'  ${TREATkeep}  ${m`k'}   ,robust
			
				outreg,  merge(base`typemodel'_dep)  nod keep( ${TREATkeep} )   ///
						 pretext(  "\caption{`labout'}" "\begin{adjustbox}{max width=1.2  \textwidth,center}")  ///
						${option} ctitle("sample ${mods}", "(`k') " )  ///
						addrows("","" \  "${model_`k'}" \ "","" \ "Average outcome", `av' ) 		
			}
			}			
			}
	
   outreg  , replace  replay(baseT1_dep) append(baseT1b_dep)  $option  
				
	
	

	